<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表视图</title>
</head>
<body>


{% if search_list %}
    <form method="get">
        <label id="keyword"></label>
        <input type="text" name="q" id="keyword" value="{{ search_value }}">
        <input type="submit" value="搜索">
    </form>
{% endif %}

<form method="post">
    {% csrf_token %}
    {% if add_btn %}
        {{ add_btn }}
    {% endif %}
    {% if action_dict %}
        <select name="action">
            <option>请选择操作</option>
            {% for action_name, action_text in action_dict.items %}
                <option value="{{ action_name }}">{{ action_text }}</option>
            {% endfor %}
        </select>
        <input type="submit" value="执行">
    {% endif %}
    <table border="1">
        <thead>
        <tr>
            {% for th in table_header %}
                <th>{{ th }}</th>
            {% endfor %}
        </tr>
        </thead>
        <tbody>
        {% for row in table_body %}
            <tr>
                {% for th in row %}
                    <th>{{ th }}</th>
                {% endfor %}
            </tr>
        {% endfor %}
        </tbody>
    </table>

</form>


</body>
</html>